package com.zijidelu.luframework.base.message.impl;

import com.zijidelu.luframework.base.message.Message;

/**
 * 分布式锁消息。
 *
 * @author ZIJIDELU
 * @date 2024/5/1 12:38
 */
public enum DistributedLockMessage implements Message {
    /**
     * 尝试加锁失败
     */
    TRY_LOCK_FAIL(false, 1, "请求超时，请稍后再试！");

    private final boolean isSuccess;
    private final int code;
    private final String message;

    DistributedLockMessage(boolean isSuccess, int code, String text) {
        this.isSuccess = isSuccess;
        this.code = code;
        this.message = text;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getText() {
        return message;
    }

    @Override
    public boolean isSuccess() {
        return isSuccess;
    }
}
